package org.sparkle.html.impl.basic;

import org.sparkle.html.api.AbstractHtmlElement;

public class ComboBox extends AbstractHtmlElement{

	/**
	 * 
	 */
	private static final long serialVersionUID = 6369622145585011739L;

	public ComboBox(String name) {
		addAttr("name", name);
	}
	
	@Override
	public String getTag() {
		return "select";
	}
	
	public void addOption(Option option){
		append(option);
	}
	
	public static class Option extends AbstractHtmlElement{
		/**
		 * 
		 */
		private static final long serialVersionUID = 1597608367538109063L;
		
		public Option(String value,String text) {
			addAttr("value", value);
			setText(text);
		}
		
		public Option(String value,AbstractHtmlElement el) {
			addAttr("value", value);
			append(el);
		}

		@Override
		public String getTag() {
			return "option";
		}
	}
	
}
